$data = fopen ($image, 'rb'); $size=filesize ($image); $contents= fread ($data, $size); fclose ($data);